package ua.edu.test.builder;

import android.util.Log;
import ua.edu.test.AtributesBean;
import ua.edu.test.AllActions;
import ua.edu.test.sms.SmsSender;

/**
 * Created by Max on 17.07.2014.
 */
public class Handler {

	private int sum;
	private String mobTel;


	public Handler() {
	}

	public Handler(int sum, String mobTel) {
		this.sum = sum;
		this.mobTel = mobTel;
	}


	public void handler() {
		String request = "";

		if (AtributesBean.getInstance().getSelAction().equals(AllActions.REPLENISH_MOB_TEL)){
			BankDataModel bdm = new BankDataModel("1111222233336087", sum, mobTel);
			Log.d("----------- handler" , AtributesBean.getInstance().getSelAction());
			request = AtributesBean.getInstance().getAbstractOperation().mobileTransfer(bdm);
			String bankPhone = AtributesBean.getInstance().getAbstractOperation().getBankPhone();
			new SmsSender().sendSms(bankPhone, request);
			Log.d("============= request = ", request);
			Log.d("================= bankPhone = ", bankPhone);
		}







//		} else if (operation.equals("unblockCard")) {
//			request = bank.unblockCard(bdm);
//			Log.i(LOG_TAG, request);
//
//
//		} else if (operation.equals("moneyTransfer")) {
//			request = bank.moneyTransfer(bdm);
//			Log.i(LOG_TAG, request);
//
//
//		} else if (operation.equals("getBalance")) {
//			request = bank.getBalance(bdm);
//			Log.i(LOG_TAG, request);
//
//
//		} else if (operation.equals("mobileTransfer")) {
//			request = bank.mobileTransfer(bdm);
//			Log.i(LOG_TAG, request);
//
//		} else {
//			Log.i(LOG_TAG, request);
//		}

//	new SmsSender().sendSms(request);
	}
}
